home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 21 / AACD 21.iso / AACD / Sound / DelfinaMPEG / src / device.asm < prev    next >
Encoding:
Assembly Source File  |  2001-04-07  |  14.6 KB  |  635 lines

  1. ;*****************************************************************************
  2. ;
  3. ;    delfinampeg.device - mpeg.device for Delfina DSP
  4. ;    Copyright (C) 2000, 2001  Michael Henke
  5. ;
  6. ;    This program is free software; you can redistribute it and/or modify
  7. ;    it under the terms of the GNU General Public License as published by
  8. ;    the Free Software Foundation; either version 2 of the License, or
  9. ;    (at your option) any later version.
  10. ;
  11. ;    This program is distributed in the hope that it will be useful,
  12. ;    but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. ;    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14. ;    GNU General Public License for more details.
  15. ;
  16. ;    You should have received a copy of the GNU General Public License
  17. ;    along with this program; if not, write to the Free Software
  18. ;    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  19. ;
  20. ;*****************************************************************************
  21.  
  22.  
  23. ;** based on the framework of melodympeg.device
  24. ;** (C) Copyright 1998-2000 Kato Development (Thorsten Hansen)
  25.  
  26.  
  27. VERSION        EQU    1
  28. REVISION    EQU    1
  29.  
  30. ; Hiermit wird das Device nach dem schliessen wieder automatisch
  31. ; aus dem System entfernt (EXPUNGE = 1). Sonst auf 0 setzen.
  32. ;;EXPUNGE        SET    1
  33.  
  34.  
  35.     include "exec/exec.i"
  36.     include "hardware/intbits.i"
  37.     include "libraries/configvars.i"
  38.     include "libraries/configregs.i"
  39.     include "utility/utility.i"
  40.     include "utility/tagitem.i"
  41.  
  42.     include    "melodympeg.i"
  43.  
  44.     XDEF    _DevName
  45.     XDEF    _DelfinaBase
  46.  
  47.     XREF    _C_initunit    ;unit init
  48.     XREF    _C_expungeunit    ;unit expunge
  49.     XREF    _C_setpause    ;MPEGCMD_PAUSE
  50.     XREF    _C_setvolume    ;MPEGCMD_SETAUDIOPARAMS
  51.     XREF    _C_flush    ;CMD_FLUSH
  52.     XREF    _C_write    ;CMD_WRITE
  53.  
  54. *
  55. * Device Data Structure
  56. *
  57.  
  58. MAX_UNITS    equ    1
  59.  
  60. ; Hier Device globale Daten sichern (Library ptr, etc.)
  61.  
  62.  STRUCTURE MelodyDev,LIB_SIZE
  63.     UBYTE    md_Flags
  64.     UBYTE    md_Pad1
  65.     APTR    md_SysLib
  66.     APTR    md_SegList
  67.     STRUCT    md_Units,MAX_UNITS*4    ; Unit Ptr
  68.     LABEL    MelodyDev_SIZE
  69.  
  70.  
  71.  
  72. ****************************************************************************
  73.  
  74.  
  75.  
  76.     section    mycode,code
  77.  
  78.         moveq #-1,d0        ;don't try do run this!
  79.         rts                                
  80.  
  81. InitTable    dc.w    RTC_MATCHWORD
  82.         dc.l    InitTable
  83.         dc.l    EndCode
  84.         dc.b    RTF_AUTOINIT
  85.         dc.b    VERSION
  86.         dc.b    NT_DEVICE
  87.         dc.b    0        ;DevPri
  88.         dc.l    _DevName
  89.         dc.l    IDString
  90.         dc.l    Init__
  91.  
  92. _DevName    dc.b    "delfinampeg.device",0
  93.  
  94.         dc.b    "$VER:"
  95. IDString    dc.b    "delfinampeg.device 1.1 (07.04.2001)"
  96.         dc.b    " written by Michael Henke",0
  97.  
  98. delflibname    dc.b    "delfina.library",0
  99.  
  100.  
  101. *
  102. * board description (256 byte)
  103. *
  104. * Dies ist eine kurze Beschreibung des MPEG Device. Diese kann von
  105. * der Anwendung abgefragt werden.
  106. *
  107.     cnop    0,4
  108. BoardDesc
  109.     dc.b    "MPEG audio decoder for Delfina DSP."
  110.     dc.b    " supports MPEG-1 audio Layer II/III."
  111.     dc.b    " written by Michael Henke."
  112. endtext
  113.     dcb.b    256-(endtext-BoardDesc),0
  114.  
  115.         cnop    0,4
  116.  
  117. _DelfinaBase    dc.l    0    ;filled by device Init routine
  118.  
  119. Init__        dc.l    MelodyDev_SIZE
  120.         dc.l    funcTable
  121.         dc.l    dataTable
  122.         dc.l    initRoutine
  123.  
  124. funcTable    dc.l    Open__
  125.         dc.l    Close__
  126.         dc.l    Expunge__
  127.         dc.l    Null
  128.         dc.l    BeginIO__
  129.         dc.l    AbortIO__
  130.         dc.l    SetSCR__
  131.         dc.l    GetSCR__
  132.         dc.l    Null
  133.         dc.l    Null
  134.         dc.l    -1
  135.  
  136. dataTable
  137.     INITBYTE    LN_TYPE,NT_DEVICE
  138.     INITLONG    LN_NAME,_DevName
  139.     INITBYTE    LIB_FLAGS,LIBF_SUMUSED!LIBF_CHANGED
  140.     INITWORD    LIB_VERSION,VERSION
  141.     INITWORD    LIB_REVISION,REVISION
  142.     INITLONG    LIB_IDSTRING,IDString
  143.     dc.l    0
  144.  
  145.  
  146.  
  147.  
  148. ****************************************************************************
  149. *
  150. * This routine is called on the first device initialization
  151. *
  152. * -> d0 = device ptr, a0 = segment list, a6 = execbase
  153. *
  154. initRoutine
  155.     movem.l    d1-d7/a0-a6,-(a7)
  156.     move.l    d0,a5            ;device ptr
  157.     move.l    a6,md_SysLib(a5)    ;save ptr to exec
  158.     move.l    a0,md_SegList(a5)    ;save ptr to our loaded code
  159.  
  160.     lea    delflibname(pc),a1
  161.     moveq    #4,d0
  162.     jsr    -552(a6)        ;CALL OpenLibrary
  163.     move.l    d0,_DelfinaBase        ;global - for the 'C' routines
  164.     beq.b    .init_end        ;error: can't open delfina.library v4
  165.  
  166.     move.l    a5,d0            ;no error: return device
  167. .init_end
  168.     movem.l    (a7)+,d1-d7/a0-a6
  169.     rts
  170.  
  171.  
  172.  
  173.  
  174. ****************************************************************************
  175. *
  176. * Open wird beim öffnen des Device aufgerufen
  177. *
  178. * -> d0=unitnum, d1=flags, a1=ioreq, a6=device
  179. *
  180. Open__
  181.     movem.l    d2-d7/a0-a6,-(a7)
  182.     move.l    a6,a5            ; device
  183.     move.l    a1,a2
  184. ;----     valid unit number?
  185.     cmp.l    #MAX_UNITS,d0
  186.     bge    .open_err
  187. ;----     unit already initialized?
  188.     move.l    d0,d3
  189.     lea    md_Units(a5,d0.w*4),a4    ; unit ptr
  190.     move.l    (a4),d0
  191.     bne.b    .open_err
  192.     bsr    InitUnit        ; unit:d3, devptr:a5
  193. ;----     see if it initialized OK
  194.     move.l    (a4),d0
  195.     beq.b    .open_err
  196.     move.l    d0,IO_UNIT(a2)
  197.     addq    #1,LIB_OPENCNT(a5)
  198. ;----     prevent delayed expunges
  199.     bclr    #LIBB_DELEXP,md_Flags(a6)
  200.     moveq    #0,d0
  201.     move.b    d0,IO_ERROR(a2)
  202.     move.b    #NT_REPLYMSG,LN_TYPE(a2) ; Mark IORequest as "complete" !
  203. .open_end
  204.     movem.l    (a7)+,d2-d7/a0-a6
  205.     rts
  206. .open_err
  207.     moveq    #IOERR_OPENFAIL,d0
  208.     move.b    d0,IO_ERROR(a2)
  209.     move.l    d0,IO_DEVICE(a2)    ;IMPORTANT: trash IO_DEVICE on open failure
  210.     bra.b    .open_end
  211.  
  212.  
  213.  
  214. ****************************************************************************
  215. *
  216. * Close wird beim schliessen des Device aufgerufen
  217. *
  218. * -> a1=ioreq, a6=device
  219. * <- d0=seglist oder 0
  220. *
  221. Close__
  222.     movem.l    d1-d7/a1-a5,-(a7)
  223.     move.l    a6,a5            ; device ptr
  224.     move.l    IO_UNIT(a1),a3
  225.     moveq    #0,d0
  226.     move.l    a3,d1
  227.     beq.b    .close_end        ; unit ist schon geschlossen
  228. ;----     unit can be only open once one
  229.     clr.l    IO_UNIT(a1)
  230.     bsr    ExpungeUnit
  231.     moveq    #0,d0
  232.     subq    #1,LIB_OPENCNT(a6)
  233.     bne.b    .close_end
  234. ;----     see if we have a delayed expunge pending
  235.     IFND    EXPUNGE
  236.     btst    #LIBB_DELEXP,md_Flags(a6)
  237.     beq.b    .close_end
  238.     ENDC
  239.     bsr.b    Expunge__
  240. .close_end
  241.     movem.l   (a7)+,d1-d7/a1-a5
  242.     rts
  243.  
  244.  
  245.  
  246. ****************************************************************************
  247. *
  248. * Device entfernen
  249. *
  250. * -> a6=device
  251. *
  252. Expunge__
  253.     movem.l    d1-d2/a5-a6,-(a7)
  254.     move.l    a6,a5            ; device ptr
  255.     move.l    md_SysLib(a5),a6    ; ExecBase nach a6
  256.     tst    LIB_OPENCNT(a5)
  257.     beq.b    .exp_ok
  258. ;----     it is still open.  set the delayed expunge flag
  259.     bset    #LIBB_DELEXP,md_Flags(a5)
  260.     moveq    #0,d0
  261.     bra.b    .exp_end
  262. ;----     device wird entfernt
  263. .exp_ok    move.l    md_SegList(a5),d2    ; Zeiger auf Segment Liste
  264.     move.l    a5,a1            ; device
  265.     jsr    -252(a6)        ;CALL Remove  Device aus Liste löschen
  266.  
  267.     move.l    _DelfinaBase(pc),d0
  268.     beq.b    .no_delflib
  269.     move.l    d0,a1
  270.     jsr    -414(a6)        ;CALL CloseLibrary
  271. .no_delflib
  272.  
  273.     move.l    a5,a1            ; device
  274.     moveq    #0,d0
  275.     move    LIB_NEGSIZE(a5),d0
  276.     sub.l    d0,a1            ; Anfang des Speichers für device
  277.     add    LIB_POSSIZE(a5),d0    ; Laenge vom Device bestimmen
  278.     jsr    -210(a6)        ;CALL FreeMem  Speicher freigeben
  279.     move.l    d2,d0            ; Segment Liste
  280. .exp_end
  281.     movem.l    (a7)+,d1-d2/a5-a6
  282.     rts
  283.  
  284.  
  285.  
  286. Null    moveq    #0,d0
  287.     rts
  288.  
  289.  
  290. ****************************************************************************
  291. *
  292. * -> d3=unitnum, a5=device
  293. *
  294. InitUnit:
  295.     movem.l    d1-d7/a0-a6,-(a7)
  296.     move.l    d3,-(a7)        ;ULONG unitnum
  297.     jsr    _C_initunit        ;returns unit pointer
  298.     addq.l    #4,a7
  299.     movem.l    (a7)+,d1-d7/a0-a6
  300.     move.l    d0,md_Units(a5,d3.w*4)    ;store unit pointer
  301.     rts
  302.  
  303.  
  304. ****************************************************************************
  305. *
  306. * -> a3=unit, a5=device
  307. *
  308. ExpungeUnit:
  309.     movem.l    d1-d7/a0-a6,-(a7)
  310.     move.l    a3,-(a7)        ;struct devunit*
  311.     jsr    _C_expungeunit        ;returns ULONG unitnum
  312.     addq.l    #4,a7
  313.     movem.l    (a7)+,d1-d7/a0-a6
  314.     clr.l    md_Units(a5,d0.w*4)    ;clear unit pointer
  315.     rts
  316.  
  317.  
  318. ****************************************************************************
  319.  
  320. NSCMD_DEVICEQUERY    EQU    $4000
  321.  
  322.  STRUCTURE NSDeviceQueryResult,0
  323.     ULONG    dqr_DevQueryFormat
  324.     ULONG    dqr_SizeAvailable
  325.     UWORD    dqr_DeviceType
  326.     UWORD    dqr_DeviceSubType
  327.     APTR    dqr_SupportedCommands
  328.     LABEL    NSDeviceQueryResult_SIZEOF
  329.  
  330. NSDEVTYPE_UNKNOWN    EQU    0
  331.  
  332. cmdtable
  333.     dc.l    Invalid        ;0  CMD_INVALID
  334.     dc.l    CMD_Reset__    ;1  CMD_RESET
  335.     dc.l    CMD_Read__    ;2  CMD_READ            ; no op
  336.     dc.l    CMD_Write__    ;3  CMD_WRITE
  337.     dc.l    CMD_Update__    ;4  CMD_UPDATE            ; no op
  338.     dc.l    CMD_Clear__    ;5  CMD_CLEAR            ; no op
  339.     dc.l    CMD_Stop__    ;6  CMD_STOP            ; no op
  340.     dc.l    CMD_Start__    ;7  CMD_START            ; no op
  341.     dc.l    CMD_Flush__    ;8  CMD_FLUSH
  342.     dc.l    MPEG_Play    ;9  MPEGCMD_PLAY
  343.     dc.l    MPEG_Pause    ;A  MPEGCMD_PAUSE
  344.     dc.l    Invalid        ;B  MPEGCMD_SLOWMOTION        ; Not supported
  345.     dc.l    Invalid        ;C  MPEGCMD_SINGLESTEP        ; Not supported
  346.     dc.l    Invalid        ;D  MPEGCMD_SEARCH        ; Not supported
  347.     dc.l    Invalid        ;E  MPEGCMD_RECORD        ; Not supported
  348.     dc.l    MPEG_GetDevInfo ;F  MPEGCMD_GETDEVINFO
  349.     dc.l    Invalid        ;0  MPEGCMD_SETWINDOW        ; Not supported
  350.     dc.l    Invalid        ;1  MPEGCMD_SETBORDER        ; Not supported
  351.     dc.l    Invalid        ;2  MPEGCMD_GETVIDEOPARAMS    ; Not supported
  352.     dc.l    Invalid        ;3  MPEGCMD_SETVIDEOPARAMS    ; Not supported
  353.     dc.l    MPEG_SetAudPara ;4  MPEGCMD_SETAUDIOPARAMS
  354.     dc.l    Invalid        ;5  MPEGCMD_PLAYLSN        ; Not supported
  355.     dc.l    Invalid        ;6  MPEGCMD_SEEKLSN        ; Not supported
  356.     dc.l    Invalid        ;7  MPEGCMD_READFRAMEYUV    ; Not supported
  357.  
  358. cmdlist
  359.     dc.b    CMD_RESET
  360.     dc.b    CMD_WRITE
  361.     dc.b    CMD_FLUSH
  362.     dc.b    MPEGCMD_PLAY
  363.     dc.b    MPEGCMD_PAUSE
  364.     dc.b    MPEGCMD_GETDEVINFO
  365.     dc.b    MPEGCMD_SETAUDIOPARAMS
  366.     dc.b    MPEGCMD_SETEQUALIZER
  367.     dc.b    0
  368.  
  369.     cnop    0,4
  370.  
  371.  
  372.  
  373. ****************************************************************************
  374. *
  375. * BeginIO starts all incoming io. The IO is either queued up for the
  376. * unit task or processed immediately.
  377. *
  378. * -> a1=ioreq, a6=device
  379. *
  380. BeginIO__
  381.     movem.l    d1/a0/a3,-(a7)
  382.     move.b    #NT_MESSAGE,LN_TYPE(a1)    ; So WaitIO() is guaranteed to work
  383.     move.l    IO_UNIT(a1),a3        ; unit ptr
  384.     move    IO_COMMAND(a1),d0
  385.     ; NS device query test
  386.     cmp    #NSCMD_DEVICEQUERY,d0
  387.     bne.b    .no_nsdquery
  388.     bsr    NSDQuery
  389.     bra.b    .beginio_end
  390. .no_nsdquery
  391.     ; a valid command ?
  392.     cmp    #MPEGCMD_END,d0
  393.     bcc    .no_cmd
  394. .immediate
  395.     bsr.b   PerformIO__
  396. .beginio_end
  397.     movem.l    (a7)+,d1/a0/a3
  398.     rts
  399. .no_cmd    move.b    #IOERR_NOCMD,IO_ERROR(a1)
  400.     bra.b    .beginio_end
  401. *
  402. * PerformIO actually dispatches an io request.    It might be called from
  403. * the task, or directly from BeginIO (thus on the callers's schedule)
  404. *
  405. * -> a1=iorequest, a3=unitptr, a6=device
  406. *
  407. PerformIO__
  408.     moveq    #0,d0
  409.     move.b    d0,IO_ERROR(A1)        ; kein Fehler
  410.     move.b    IO_COMMAND+1(a1),d0    ; low byte
  411.     lea    cmdtable(pc),a0
  412.     move.l    (a0,d0.w*4),a0
  413.     jmp     (a0)            ; a1=ioreq, a6=devprt
  414.  
  415.  
  416.  
  417. ****************************************************************************
  418. *
  419. * AbortIO() is a REQUEST to "hurry up" processing of an IORequest.
  420. * If the IORequest was already complete, nothing happens (if an IORequest
  421. * is quick or LN_TYPE=NT_REPLYMSG, the IORequest is complete).
  422. * The message must be replied with ReplyMsg(), as normal.
  423. *
  424. * Note that AbortIO is called directly, not via BeginIO.
  425. *
  426. * If sucessful, AbortIO returns IOERR_ABORTED in IO_ERROR and zero in D0
  427. *
  428. * -> a1=iorequest, a6=device
  429. *
  430. AbortIO__
  431. ;;    moveq   #0,d0            ; error code (always successful)
  432.     moveq    #IOERR_NOCMD,d0        ; return "AbortIO() request failed"
  433.     rts
  434.  
  435.  
  436. *
  437. * -> a1=iorequest, a3=unitptr, a6=device
  438. *
  439. TermIO__
  440.     btst    #IOB_QUICK,IO_FLAGS(a1)    ; wenn quick, dann keine RyplyMsg
  441.     bne.b   .termio_end
  442.     move.l    a6,-(a7)
  443.     move.l    md_SysLib(a6),a6
  444.     jsr    -378(a6)        ;CALL ReplyMsg (sets the LN_TYPE to NT_REPLYMSG)
  445.     move.l    (a7)+,a6
  446. .termio_end
  447.     rts
  448.  
  449.  
  450. NSDQuery:
  451.     move.l    IO_DATA(a1),a0        ; NSDeviceQueryResult
  452.     move.l    IO_LENGTH(a1),d0    ; size
  453.     move    #NSDEVTYPE_UNKNOWN,dqr_DeviceType(a0)
  454.     move    #0,dqr_DeviceSubType(a0)
  455.     move.l    #cmdlist,dqr_SupportedCommands(a0)
  456.     move.l    #NSDeviceQueryResult_SIZEOF,dqr_SizeAvailable(a0)
  457.     move.l    dqr_SizeAvailable(a0),IO_ACTUAL(a1)
  458.     bra    TermIO__
  459.  
  460.  
  461. ****************************************************************************
  462. *
  463. * Setzt die aktuelle System Clock Referenze
  464. *
  465. * -> a0=unit, d0=time
  466. * <- d0=succes
  467. *
  468. SetSCR__
  469.     moveq    #0,d0
  470.     rts
  471. *
  472. * Gibt den aktuellen System Clock Reference wert
  473. *
  474. * -> a0=unit
  475. * <- d0=clockValue (die unteren 32 bits vom SCR)
  476. *
  477. GetSCR__
  478.     moveq    #0,d0
  479.     rts
  480.  
  481.  
  482.  
  483. ****************************************************************************
  484. * hier beginnnen die Funktionen der Device Befehle
  485. *
  486. * Parameter:
  487. * -> a1=iorequest, a3=unitptr, a6=device
  488. *
  489. Invalid:
  490.     move.b    #IOERR_NOCMD,IO_ERROR(a1)
  491.     bra    TermIO__
  492. *
  493. * no operation
  494. *
  495. noOp:
  496. CMD_Read__
  497. CMD_Update__
  498. CMD_Clear__
  499. CMD_Stop__
  500. CMD_Start__
  501.     clr.l    IO_ACTUAL(a1)
  502.     bra    TermIO__
  503.  
  504.  
  505. ****************************************************************************
  506. **
  507. ** MPEG device functions
  508. **
  509. * CMD_RESET - Decoder zurücksetzen
  510. *
  511. CMD_Reset__
  512. ;*** what should we do here???
  513.     bra    TermIO__
  514.  
  515.  
  516. ****************************************************************************
  517. *
  518. * CMD_FLUSH - abort all CMD_WRITE requests and flush decoder buffer
  519. *
  520. * Abspieler stoppen und alle Requests abbrechen.
  521. *
  522. CMD_Flush__
  523.     movem.l    d1-d7/a0-a6,-(a7)
  524.     move.l    a3,-(a7)        ;struct devunit*
  525.     jsr    _C_flush        ;returns nothing
  526.     addq.l    #4,a7
  527.     movem.l    (a7)+,d1-d7/a0-a6
  528.     bra    TermIO__
  529.  
  530.  
  531. ****************************************************************************
  532. *
  533. * MPEGCMD_PLAY - start playback
  534. *
  535. * In diesem Device wird die Abspielhardware in der Write Funktion gestartet.
  536. *
  537. * INPUTS:
  538. *   iomr_StreamType  - MPEGSTREAM_AUDIO, MPEGSTREAM_SYSTEM
  539. *                      oder MPEGSTREAM_BYPASS abhängig vom stream typ.
  540. *
  541. MPEG_Play:
  542. ;*** we don't need to do anything here...
  543. ;*** the first CMD_WRITE will automatically start playback
  544.     bra    TermIO__
  545.  
  546.  
  547. ****************************************************************************
  548. *
  549. * MPEGCMD_Pause - set pause mode
  550. *
  551. * INPUTS:
  552. *   iomr_StreamType  - MPEGSTREAM_AUDIO oder MPEGSTREAM_SYSTEM
  553. *                      abhängig vom stream typ.
  554. *   iomr_Arg1        - Pause-modus an: io_Arg ungleich 0
  555. *                      Pause-modus aus: io_Arg gleich 0
  556. *
  557. MPEG_Pause:
  558.     movem.l    d1-d7/a0-a6,-(a7)
  559.     move.l    a1,-(a7)        ;struct IOMPEGReq*
  560.     move.l    a3,-(a7)        ;struct devunit*
  561.     jsr    _C_setpause        ;returns nothing
  562.     addq.l    #8,a7
  563.     movem.l    (a7)+,d1-d7/a0-a6
  564.     bra    TermIO__
  565.  
  566.  
  567. ****************************************************************************
  568. *
  569. * MPEGCMD_GETDEVINFO - get device information
  570. *
  571. * INPUTS:
  572. *   IO_DATA - Zeiger auf MPEGDevInfo struktur
  573. *
  574. MPEG_GetDevInfo:
  575.     movem.l    a0-a3,-(a7)
  576.     move.l    IO_DATA(a1),a0        ; MPEGDevInfo
  577.     move    #1,mdi_Version(a0)
  578.     move    #0,mdi_Flags(a0)
  579.     move.l    #MPEGCF_PLAYRAWAUDIO|MPEGCF_PLAYAUDLAYER_II|MPEGCF_PLAYAUDLAYER_III,d0
  580.     move.l    d0,mdi_BoardCapabilities(a0)
  581.     lea    BoardDesc(pc),a2
  582.     lea    mdi_BoardDesc(a0),a3
  583.     move    #256-1,d0
  584. .copylp:
  585.     move.b    (a2)+,(a3)+
  586.     dbra    d0,.copylp
  587.     movem.l    (a7)+,a0-a3
  588.     bra    TermIO__
  589.  
  590.  
  591. ****************************************************************************
  592. *
  593. * MPEGCMD_SETAUDIOPARAMS - set playback parameter
  594. *
  595. * Hier wird die Lautstärkeregelung vorgenommen.
  596. *
  597. * INPUTS:
  598. *   IO_DATA   - Zeiger auf MPEGAudioParams structure.
  599. *   IO_LENGTH - Sizeof(struct MPEGAudioParams)
  600. *
  601. MPEG_SetAudPara:
  602.     movem.l    d1-d7/a0-a6,-(a7)
  603.     move.l    a1,-(a7)        ;struct IOMPEGReq*
  604.     move.l    a3,-(a7)        ;struct devunit*
  605.     jsr    _C_setvolume        ;returns nothing
  606.     addq.l    #8,a7
  607.     movem.l    (a7)+,d1-d7/a0-a6
  608.     bra    TermIO__
  609.  
  610.  
  611. ****************************************************************************
  612. *
  613. * CMD_WRITE - write data to play
  614. *
  615. * INPUTS:
  616. *   IO_DATA   - Zeiger auf Puffer mit Daten
  617. *   IO_LENGTH - Anzahl der Bytes im Puffer
  618. *
  619. CMD_Write__
  620.     movem.l    d1-d7/a0-a6,-(a7)
  621.     move.l    a1,-(a7)        ;struct IOMPEGReq*
  622.     move.l    a3,-(a7)        ;struct devunit*
  623.     jsr    _C_write        ;returns ULONG error
  624.     addq.l    #8,a7
  625.     movem.l    (a7)+,d1-d7/a0-a6
  626.     tst.l    d0
  627.     bne.b    .write_err
  628.     rts
  629. .write_err
  630.     bra    TermIO__
  631.  
  632.  
  633. EndCode
  634.     END
  635.